package myschool.test3;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONWriter;
import myschool.entity.Page;
import myschool.entity.Student;
import myschool.service.StudentService;

import java.io.Serializable;
import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestJson {
    //Gson ...
    public static void main(String[] args) {
        Student st=new Student();
        st.setStuno(10003);
        st.setSname("老吴");
        st.setEnterdate(new Date());
        st.setTelephone("1384783833");
        String  str = JSON.toJSONString(st,"yyyy/MM/dd", JSONWriter.Feature.NullAsDefaultValue);
        System.out.println(str);

        Page<Student> page = StudentService.ME.page(1, 20, null, null, null, null, null);
        String s2=JSON.toJSONString(page,"yyyy/MM/dd", JSONWriter.Feature.NullAsDefaultValue);
        System.out.println(s2);
    }
}
